Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@ampproject/toolbox-runtime-version
Advanced tools
Use it to query cdn.ampproject.org
for the current release or canary version of the AMP Runtime. Uses a stale-while-revalidate caching strategy to avoid network requests in the critical path.
You can use the API to re-write AMP runtime URLs to their versioned counter parts to improve browser caching, e.g. to replace:
https://cdn.ampproject.org/v0.css
with:
https://cdn.ampproject.org/rtv/001515617716922/v0.css
Install via:
npm install @ampproject/toolbox-runtime-version
Basic usage:
const runtimeVersion = require('@ampproject/toolbox-runtime-version');
// Release version
runtimeVersion.currentVersion().then(version => {
console.log(version);
});
// Canary version
runtimeVersion.currentVersion({canary: true}).then(version => {
console.log(version);
});
// Rewriting cache URLs
const ampRuntimeUrl = 'https://cdn.ampproject.org/v0.js';
const version = await runtimeVersion.currentVersion();
const versionedAmpRuntimeUrl = ampRuntimeUrl.replace(
'https://cdn.ampproject.org/',
'https://cdn.ampproject.org/rtv/' + version + '/'
);
console.log(versionedAmpRuntimeUrl);
FAQs
AMP Runtime versions
The npm package @ampproject/toolbox-runtime-version receives a total of 49,687 weekly downloads. As such, @ampproject/toolbox-runtime-version popularity was classified as popular.
We found that @ampproject/toolbox-runtime-version demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.